package cn.abcsys.devops.application.dao;

import cn.abcsys.devops.application.model.ApplicationInstanceRelation;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository(value="applicationInstanceRelationMapper")
public interface ApplicationInstanceRelationMapper {
    int deleteByPrimaryKey(Integer applicationInstanceRelationId);

    int insert(ApplicationInstanceRelation record);

    int insertSelective(ApplicationInstanceRelation record);

    ApplicationInstanceRelation selectByPrimaryKey(Integer applicationInstanceRelationId);

    int updateByPrimaryKeySelective(ApplicationInstanceRelation record);

    int updateByPrimaryKey(ApplicationInstanceRelation record);

    List<ApplicationInstanceRelation> selectByApplicationCoreId(Integer applicationCoreId);

    int selectCountByApplicationCoreIdAndStatus(@Param("applicationCoreId") Integer applicationCoreId,@Param("status") String status);

    List<ApplicationInstanceRelation> selectDistinctImageIdByApplicationCoreId(@Param("applicationCoreId")Integer applicationCoreId,
                                                                               @Param("page") int page,@Param("rows") int rows);
    Integer selectDistinctImageCountIdByApplicationCoreId(@Param("applicationCoreId")Integer applicationCoreId);

    //runtime consideration
    Integer selectRunningCountInRuntimeId(Integer runtimeId);
}